<template>
  <div>
    {{ num }}
    {{ sex }}
    <button @click="changefn">按钮</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      num: 1,
      sex: "女",
    };
  },

  created() {},

  methods: {
    changefn() {
      if (this.num === 0) {
        this.sex = "女";
        this.num = 1;
      } else {
        this.sex = "男";
        this.num = 0;
      }
    },
  },
};
</script>

<style scoped lang='less'>
</style>
